<template>
    <el-sub-menu v-if="item.children && item.children.length > 0" :index="item.Id.toString()">
        <template #title>
            <span>{{ item.Label }}</span>
        </template>
        <NestedMenuItem v-for="(child, i) in item.children" :key="i" :item="child" />
    </el-sub-menu>
    <el-menu-item v-else :index="item.path" @click="onMenuClick(item)">
        {{ item.Label }}
    </el-menu-item>
</template>

<script>
// import { ElSubmenu } from 'element-plus';



export default {
    name: 'NestedMenuItem',
    props: ['item'],
    components: {
        // ElSubmenu
    },
    mounted() {
    }
    ,
    methods: {
        onMenuClick(item) {
            console.log('onMenuClick', item)
            this.$router.push(item.path)
        }
    }
}
</script>